/****h* scdbxml/reconstitute.c
 *  NAME
 *    reconstitute.c
 *  DESCRIPTION
 *********/
#include "reconstitute.h"

/****f* reconstitute.c/main
 *  NAME
 *    main
 *  SYNOPSIS
 *    int main(int argc, char **argv) 
 *  ARGUMENTS
 *  RETURN TYPE
 *  AUTHOR
 *  SOURCE
*/
int main(int argc, char **argv) 
{
	 userReaderCtxt ctxt;

	 /*
		* check for name of db and document ID
		*/
	 if (argc < 3) 
		 {
				printf("usage: %s database doc_id\n", argv[0]);
				return 1;
		 }
	 	 
	 ctxt = userReaderCtxtInitialise(argv[1]);
	 getDocument(ctxt, atoi(argv[2]));
	 
	 if (SCDBXML_OK != ctxt->error) 
		 {
				fprintf(stderr, "error: %d (%s:%d)\n", ctxt->error, ctxt->file, ctxt->line);
				return EXIT_FAILURE;
		 }

	 return EXIT_SUCCESS;
}
/************ main */
